GCC = g++
CPPFLAGS = -g -finline-functions -Wall -Winline -pipe -DOS_LINUX
HEAD_INFO = -DPROJECT_NAME="\"FASTSEARCH\"" -DDESCRIPTION="\"FastSearch indexer\""
	  
INCLUDES = -I./ -I../../common/commonlib/output/include \
	   -I../../common/ictclas/ \
	   -I../../common/sparsehash/include \
	   -I../../common/termindex \
	   -I../../common/unitResource \
	   -I../../common/sign/ \
	   -I../../common/descriptorManager/ \
	   -I../resource_processor/\
	   -I../common/

LIBS     = -L./ -L../../common/commonlib/output/lib -lcommonlib \
	   -L../../common/ictclas/ -lICTCLAS2011 \
	   -L../../common/sign/ -lsign \
	   -L../../common/descriptorManager/ -ldescriptorManager \
	   -lpthread

all :termlistreader displayreader unitChecker idxreader idx1reader idx0reader idxcheck idx0check idx1check

termlistreader :termlistreader.o
	$(GCC) -o $@ $^ $(INCLUDES) $(HEAD_INFO) $(LIBS)

displayreader :displayreader.o
	$(GCC) -o $@ $^ $(INCLUDES) $(HEAD_INFO) $(LIBS)

unitChecker :unitChecker.o
	$(GCC) -o $@ $^ $(INCLUDES) $(HEAD_INFO) $(LIBS)

idxreader : idxreader.o
	$(GCC) -o $@ $^ $(INCLUDES) $(HEAD_INFO) $(LIBS)

idx1reader : idx1reader.o
	$(GCC) -o $@ $^ $(INCLUDES) $(HEAD_INFO) $(LIBS)

idx0reader : idx0reader.o
	$(GCC) -o $@ $^ $(INCLUDES) $(HEAD_INFO) $(LIBS)
idx0check : idx0check.o
	$(GCC) -o $@ $^ $(INCLUDES) $(HEAD_INFO) $(LIBS)
idxcheck : idxcheck.o
	$(GCC) -o $@ $^ $(INCLUDES) $(HEAD_INFO) $(LIBS)
idx1check : idx1check.o
	$(GCC) -o $@ $^ $(INCLUDES) $(HEAD_INFO) $(LIBS)

%.o : %.cpp
	$(GCC) $(CPPFLAGS) $(HEAD_INFO) -c $< -o $@ $(INCLUDES)

clean :
	rm -f *.o
	rm -f termlistreader displayreader idxreader idx1reader idx0reader idxcheck idx0check idx1check unitChecker
	rm -rf output

